﻿using System;
using System.Collections.Generic;
using autoMessage.Entities;
using Microsoft.EntityFrameworkCore;
using NetAutoGUI;

namespace autoMessage.DbContexts;

//该配置类及实体类均为EF反向工程生成，请勿修改
public partial class ItsContext : DbContext
{
    public ItsContext()
    {
    }

    public ItsContext(DbContextOptions<ItsContext> options)
        : base(options)
    {
    }

    public virtual DbSet<AutoCheckNetEquip> AutoCheckNetEquips { get; set; }

    public virtual DbSet<ClientEvent> ClientEvents { get; set; }

    public virtual DbSet<GenTable> GenTables { get; set; }

    public virtual DbSet<GenTableColumn> GenTableColumns { get; set; }

    public virtual DbSet<ImportantWork> ImportantWorks { get; set; }

    public virtual DbSet<OperationBaseArchive> OperationBaseArchives { get; set; }

    public virtual DbSet<OperationBaseArchiveDetail> OperationBaseArchiveDetails { get; set; }

    public virtual DbSet<OperationEquipmentArchive> OperationEquipmentArchives { get; set; }

    public virtual DbSet<OperationEvent> OperationEvents { get; set; }

    public virtual DbSet<OperationIssueArchive> OperationIssueArchives { get; set; }

    public virtual DbSet<OperationRoutineArchive> OperationRoutineArchives { get; set; }

    public virtual DbSet<OperationRoutineArchiveDetail> OperationRoutineArchiveDetails { get; set; }

    public virtual DbSet<QrtzBlobTrigger> QrtzBlobTriggers { get; set; }

    public virtual DbSet<QrtzCalendar> QrtzCalendars { get; set; }

    public virtual DbSet<QrtzCronTrigger> QrtzCronTriggers { get; set; }

    public virtual DbSet<QrtzFiredTrigger> QrtzFiredTriggers { get; set; }

    public virtual DbSet<QrtzJobDetail> QrtzJobDetails { get; set; }

    public virtual DbSet<QrtzLock> QrtzLocks { get; set; }

    public virtual DbSet<QrtzPausedTriggerGrp> QrtzPausedTriggerGrps { get; set; }

    public virtual DbSet<QrtzSchedulerState> QrtzSchedulerStates { get; set; }

    public virtual DbSet<QrtzSimpleTrigger> QrtzSimpleTriggers { get; set; }

    public virtual DbSet<QrtzSimpropTrigger> QrtzSimpropTriggers { get; set; }

    public virtual DbSet<QrtzTrigger> QrtzTriggers { get; set; }

    public virtual DbSet<SysConfig> SysConfigs { get; set; }

    public virtual DbSet<SysDept> SysDepts { get; set; }

    public virtual DbSet<SysDeptNetEquip> SysDeptNetEquips { get; set; }

    public virtual DbSet<SysDictDatum> SysDictData { get; set; }

    public virtual DbSet<SysDictType> SysDictTypes { get; set; }

    public virtual DbSet<SysJob> SysJobs { get; set; }

    public virtual DbSet<SysJobLog> SysJobLogs { get; set; }

    public virtual DbSet<SysLogininfor> SysLogininfors { get; set; }

    public virtual DbSet<SysMenu> SysMenus { get; set; }

    public virtual DbSet<SysNotice> SysNotices { get; set; }

    public virtual DbSet<SysOperLog> SysOperLogs { get; set; }

    public virtual DbSet<SysPost> SysPosts { get; set; }

    public virtual DbSet<SysRole> SysRoles { get; set; }

    public virtual DbSet<SysRoleDept> SysRoleDepts { get; set; }

    public virtual DbSet<SysRoleMenu> SysRoleMenus { get; set; }

    public virtual DbSet<SysUser> SysUsers { get; set; }

    public virtual DbSet<SysUserOnline> SysUserOnlines { get; set; }

    public virtual DbSet<SysUserPost> SysUserPosts { get; set; }

    public virtual DbSet<SysUserRole> SysUserRoles { get; set; }
    
    //可在此处修改数据库链接
    protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder)
        => optionsBuilder.UseMySql("", ServerVersion.Parse("5.7.43-mysql"));

    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        modelBuilder
            .UseCollation("utf8mb4_general_ci")
            .HasCharSet("utf8mb4");

        modelBuilder.Entity<AutoCheckNetEquip>(entity =>
        {
            entity.HasKey(e => e.AutoCheckNetEquipId).HasName("PRIMARY");

            entity.ToTable("auto_check_net_equip", tb => tb.HasComment("网络设备自动巡检信息"));

            entity.Property(e => e.AutoCheckNetEquipId)
                .HasComment("网络设备自动巡检信息ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("auto_check_net_equip_id");
            entity.Property(e => e.CheckTime)
                .HasComment("网络设备自动巡检时间")
                .HasColumnType("datetime")
                .HasColumnName("check_time");
            entity.Property(e => e.NetEquipCpu5minUsage)
                .HasMaxLength(16)
                .HasComment("网络设备CPU5分钟使用率")
                .HasColumnName("net_equip_cpu_5min_usage");
            entity.Property(e => e.NetEquipInterfaceBrief)
                .HasMaxLength(16)
                .HasComment("网络设备网口双工状态")
                .HasColumnName("net_equip_interface_brief");
            entity.Property(e => e.NetEquipIp)
                .HasMaxLength(64)
                .HasComment("网络设备IP")
                .HasColumnName("net_equip_ip");
            entity.Property(e => e.NetEquipMemoryFreeRatio)
                .HasMaxLength(16)
                .HasComment("网络设备内存空闲率")
                .HasColumnName("net_equip_memory_free_ratio");
            entity.Property(e => e.NetEquipPower)
                .HasMaxLength(16)
                .HasComment("网络设备电源状态")
                .HasColumnName("net_equip_power");
            entity.Property(e => e.NetEquipTemperature)
                .HasMaxLength(16)
                .HasComment("网络设备温度")
                .HasColumnName("net_equip_temperature");
            entity.Property(e => e.NetEquipTime)
                .HasMaxLength(64)
                .HasComment("网络设备时间")
                .HasColumnName("net_equip_time");
            entity.Property(e => e.NetEquipUptime)
                .HasMaxLength(64)
                .HasComment("网络设备上线时间")
                .HasColumnName("net_equip_uptime");
            entity.Property(e => e.NetEquipVersion)
                .HasMaxLength(128)
                .HasComment("网络设备软件版本")
                .HasColumnName("net_equip_version");
        });

        modelBuilder.Entity<ClientEvent>(entity =>
        {
            entity.HasKey(e => e.ClientEventId).HasName("PRIMARY");

            entity
                .ToTable("client_event", tb => tb.HasComment("终端事件表"))
                .HasCharSet("utf8")
                .UseCollation("utf8_general_ci");

            entity.Property(e => e.ClientEventId)
                .HasComment("事件id")
                .HasColumnType("int(8)")
                .HasColumnName("client_event_id");
            entity.Property(e => e.ClientEventClassId)
                .HasComment("事件类别id")
                .HasColumnType("int(8)")
                .HasColumnName("client_event_class_id");
            entity.Property(e => e.ClientEventCreaterId)
                .HasComment("事件创建人id")
                .HasColumnType("int(8)")
                .HasColumnName("client_event_creater_id");
            entity.Property(e => e.ClientEventDescription)
                .HasMaxLength(512)
                .HasComment("事件描述")
                .HasColumnName("client_event_description");
            entity.Property(e => e.ClientEventHandlerId)
                .HasComment("事件处理人id")
                .HasColumnType("int(8)")
                .HasColumnName("client_event_handler_id");
            entity.Property(e => e.ClientEventImportantOrNot)
                .HasComment("是否为重点跟踪事件")
                .HasColumnType("int(2)")
                .HasColumnName("client_event_important_or_not");
            entity.Property(e => e.ClientEventLevel)
                .HasComment("事件等级")
                .HasColumnType("int(2)")
                .HasColumnName("client_event_level");
            entity.Property(e => e.ClientEventNote)
                .HasMaxLength(512)
                .HasComment("事件备注")
                .HasColumnName("client_event_note");
            entity.Property(e => e.ClientEventNum)
                .HasMaxLength(32)
                .HasComment("事件编号")
                .HasColumnName("client_event_num");
            entity.Property(e => e.ClientEventReportBranchId)
                .HasComment("事件上报机构id")
                .HasColumnType("int(8)")
                .HasColumnName("client_event_report_branch_id");
            entity.Property(e => e.ClientEventReportTime)
                .HasComment("事件上报时间")
                .HasColumnType("datetime")
                .HasColumnName("client_event_report_time");
            entity.Property(e => e.ClientEventReporter)
                .HasMaxLength(32)
                .HasComment("事件上报人")
                .HasColumnName("client_event_reporter");
            entity.Property(e => e.ClientEventReporterNum)
                .HasMaxLength(32)
                .HasComment("事件上报人工号")
                .HasColumnName("client_event_reporter_num");
            entity.Property(e => e.ClientEventReporterTel)
                .HasMaxLength(64)
                .HasComment("上报人电话号码")
                .HasColumnName("client_event_reporter_tel");
            entity.Property(e => e.ClientEventSolution)
                .HasMaxLength(512)
                .HasComment("事件解决方案")
                .HasColumnName("client_event_solution");
            entity.Property(e => e.ClientEventSolutionTime)
                .HasComment("事件解决时间")
                .HasColumnType("datetime")
                .HasColumnName("client_event_solution_time");
            entity.Property(e => e.ClientEventStatus)
                .HasDefaultValueSql("'0'")
                .HasComment("事件状态")
                .HasColumnType("int(2)")
                .HasColumnName("client_event_status");
        });

        modelBuilder.Entity<GenTable>(entity =>
        {
            entity.HasKey(e => e.TableId).HasName("PRIMARY");

            entity.ToTable("gen_table", tb => tb.HasComment("代码生成业务表"));

            entity.Property(e => e.TableId)
                .HasComment("编号")
                .HasColumnType("bigint(20)")
                .HasColumnName("table_id");
            entity.Property(e => e.BusinessName)
                .HasMaxLength(30)
                .HasComment("生成业务名")
                .HasColumnName("business_name");
            entity.Property(e => e.ClassName)
                .HasMaxLength(100)
                .HasDefaultValueSql("''")
                .HasComment("实体类名称")
                .HasColumnName("class_name");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.FunctionAuthor)
                .HasMaxLength(50)
                .HasComment("生成功能作者")
                .HasColumnName("function_author");
            entity.Property(e => e.FunctionName)
                .HasMaxLength(50)
                .HasComment("生成功能名")
                .HasColumnName("function_name");
            entity.Property(e => e.GenPath)
                .HasMaxLength(200)
                .HasDefaultValueSql("'/'")
                .HasComment("生成路径（不填默认项目路径）")
                .HasColumnName("gen_path");
            entity.Property(e => e.GenType)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("生成代码方式（0zip压缩包 1自定义路径）")
                .HasColumnName("gen_type");
            entity.Property(e => e.ModuleName)
                .HasMaxLength(30)
                .HasComment("生成模块名")
                .HasColumnName("module_name");
            entity.Property(e => e.Options)
                .HasMaxLength(1000)
                .HasComment("其它生成选项")
                .HasColumnName("options");
            entity.Property(e => e.PackageName)
                .HasMaxLength(100)
                .HasComment("生成包路径")
                .HasColumnName("package_name");
            entity.Property(e => e.Remark)
                .HasMaxLength(500)
                .HasComment("备注")
                .HasColumnName("remark");
            entity.Property(e => e.SubTableFkName)
                .HasMaxLength(64)
                .HasComment("子表关联的外键名")
                .HasColumnName("sub_table_fk_name");
            entity.Property(e => e.SubTableName)
                .HasMaxLength(64)
                .HasComment("关联子表的表名")
                .HasColumnName("sub_table_name");
            entity.Property(e => e.TableComment)
                .HasMaxLength(500)
                .HasDefaultValueSql("''")
                .HasComment("表描述")
                .HasColumnName("table_comment");
            entity.Property(e => e.TableName)
                .HasMaxLength(200)
                .HasDefaultValueSql("''")
                .HasComment("表名称")
                .HasColumnName("table_name");
            entity.Property(e => e.TplCategory)
                .HasMaxLength(200)
                .HasDefaultValueSql("'crud'")
                .HasComment("使用的模板（crud单表操作 tree树表操作 sub主子表操作）")
                .HasColumnName("tpl_category");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        });

        modelBuilder.Entity<GenTableColumn>(entity =>
        {
            entity.HasKey(e => e.ColumnId).HasName("PRIMARY");

            entity.ToTable("gen_table_column", tb => tb.HasComment("代码生成业务表字段"));

            entity.Property(e => e.ColumnId)
                .HasComment("编号")
                .HasColumnType("bigint(20)")
                .HasColumnName("column_id");
            entity.Property(e => e.ColumnComment)
                .HasMaxLength(500)
                .HasComment("列描述")
                .HasColumnName("column_comment");
            entity.Property(e => e.ColumnName)
                .HasMaxLength(200)
                .HasComment("列名称")
                .HasColumnName("column_name");
            entity.Property(e => e.ColumnType)
                .HasMaxLength(100)
                .HasComment("列类型")
                .HasColumnName("column_type");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.DictType)
                .HasMaxLength(200)
                .HasDefaultValueSql("''")
                .HasComment("字典类型")
                .HasColumnName("dict_type");
            entity.Property(e => e.HtmlType)
                .HasMaxLength(200)
                .HasComment("显示类型（文本框、文本域、下拉框、复选框、单选框、日期控件）")
                .HasColumnName("html_type");
            entity.Property(e => e.IsEdit)
                .HasMaxLength(1)
                .IsFixedLength()
                .HasComment("是否编辑字段（1是）")
                .HasColumnName("is_edit");
            entity.Property(e => e.IsIncrement)
                .HasMaxLength(1)
                .IsFixedLength()
                .HasComment("是否自增（1是）")
                .HasColumnName("is_increment");
            entity.Property(e => e.IsInsert)
                .HasMaxLength(1)
                .IsFixedLength()
                .HasComment("是否为插入字段（1是）")
                .HasColumnName("is_insert");
            entity.Property(e => e.IsList)
                .HasMaxLength(1)
                .IsFixedLength()
                .HasComment("是否列表字段（1是）")
                .HasColumnName("is_list");
            entity.Property(e => e.IsPk)
                .HasMaxLength(1)
                .IsFixedLength()
                .HasComment("是否主键（1是）")
                .HasColumnName("is_pk");
            entity.Property(e => e.IsQuery)
                .HasMaxLength(1)
                .IsFixedLength()
                .HasComment("是否查询字段（1是）")
                .HasColumnName("is_query");
            entity.Property(e => e.IsRequired)
                .HasMaxLength(1)
                .IsFixedLength()
                .HasComment("是否必填（1是）")
                .HasColumnName("is_required");
            entity.Property(e => e.JavaField)
                .HasMaxLength(200)
                .HasComment("JAVA字段名")
                .HasColumnName("java_field");
            entity.Property(e => e.JavaType)
                .HasMaxLength(500)
                .HasComment("JAVA类型")
                .HasColumnName("java_type");
            entity.Property(e => e.QueryType)
                .HasMaxLength(200)
                .HasDefaultValueSql("'EQ'")
                .HasComment("查询方式（等于、不等于、大于、小于、范围）")
                .HasColumnName("query_type");
            entity.Property(e => e.Sort)
                .HasComment("排序")
                .HasColumnType("int(11)")
                .HasColumnName("sort");
            entity.Property(e => e.TableId)
                .HasMaxLength(64)
                .HasComment("归属表编号")
                .HasColumnName("table_id");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        });

        modelBuilder.Entity<ImportantWork>(entity =>
        {
            entity.HasKey(e => e.ImportantWorkId).HasName("PRIMARY");

            entity.ToTable("important_work");

            entity.Property(e => e.ImportantWorkId)
                .HasColumnType("bigint(20)")
                .HasColumnName("important_work_id");
            entity.Property(e => e.ImportantWorkDescription)
                .HasMaxLength(512)
                .HasComment("重要工作描述")
                .HasColumnName("important_work_description");
            entity.Property(e => e.ImportantWorkProgress)
                .HasMaxLength(128)
                .HasComment("重要工作进展")
                .HasColumnName("important_work_progress");
            entity.Property(e => e.ImportantWorkTopic)
                .HasMaxLength(256)
                .HasComment("重要工作标题")
                .HasColumnName("important_work_topic");
            entity.Property(e => e.ImportantWorkType)
                .HasComment("重要工作类别：1终端类、2运行类")
                .HasColumnType("int(2)")
                .HasColumnName("important_work_type");
        });

        modelBuilder.Entity<OperationBaseArchive>(entity =>
        {
            entity.HasKey(e => e.OperationBaseArchiveId).HasName("PRIMARY");

            entity.ToTable("operation_base_archive", tb => tb.HasComment("分支行运行基础档案"));

            entity.Property(e => e.OperationBaseArchiveId)
                .HasComment("基础档案ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_base_archive_id");
            entity.Property(e => e.OperationBaseArchiveCreateTime)
                .HasComment("基础档案创建时间")
                .HasColumnType("datetime")
                .HasColumnName("operation_base_archive_create_time");
            entity.Property(e => e.OperationBaseArchiveDescription)
                .HasMaxLength(512)
                .HasComment("基础档案描述")
                .HasColumnName("operation_base_archive_description");
            entity.Property(e => e.OperationBaseArchiveName)
                .HasMaxLength(64)
                .HasComment("基础档案名称")
                .HasColumnName("operation_base_archive_name");
            entity.Property(e => e.OperationBaseArchiveUpdateTime)
                .HasComment("基础档案更新时间")
                .HasColumnType("datetime")
                .HasColumnName("operation_base_archive_update_time");
        });

        modelBuilder.Entity<OperationBaseArchiveDetail>(entity =>
        {
            entity.HasKey(e => e.OperationBaseArchiveDetailId).HasName("PRIMARY");

            entity.ToTable("operation_base_archive_detail", tb => tb.HasComment("分支行运行基础档案详情"));

            entity.Property(e => e.OperationBaseArchiveDetailId)
                .HasComment("基础档案详情ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_base_archive_detail_id");
            entity.Property(e => e.DeptId)
                .HasComment("所属行部ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("dept_id");
            entity.Property(e => e.OperationBaseArchiveDetailFileName)
                .HasMaxLength(128)
                .HasComment("基础档案详情附件名称")
                .HasColumnName("operation_base_archive_detail_file_name");
            entity.Property(e => e.OperationBaseArchiveDetailFilePath)
                .HasMaxLength(4096)
                .HasComment("基础档案详情附件路径（使用逗号分割多个附件）")
                .HasColumnName("operation_base_archive_detail_file_path");
            entity.Property(e => e.OperationBaseArchiveDetailIsSpecial)
                .HasComment("基础档案详情是否存在特殊情况")
                .HasColumnType("int(4)")
                .HasColumnName("operation_base_archive_detail_is_special");
            entity.Property(e => e.OperationBaseArchiveDetailSpecialDescription)
                .HasMaxLength(4096)
                .HasComment("基础档案详情特殊情况描述")
                .HasColumnName("operation_base_archive_detail_special_description");
            entity.Property(e => e.OperationBaseArchiveId)
                .HasComment("基础档案ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_base_archive_id");
        });

        modelBuilder.Entity<OperationEquipmentArchive>(entity =>
        {
            entity.HasKey(e => e.OperationEquipmentArchiveId).HasName("PRIMARY");

            entity.ToTable("operation_equipment_archive", tb => tb.HasComment("设备档案"));

            entity.Property(e => e.OperationEquipmentArchiveId)
                .HasComment("设备档案ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_equipment_archive_id");
            entity.Property(e => e.DeptId)
                .HasComment("部门ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("dept_id");
            entity.Property(e => e.EmEqptActivationTime)
                .HasComment("环控设备启用时间")
                .HasColumnType("datetime")
                .HasColumnName("em_eqpt_activation_time");
            entity.Property(e => e.EmEqptExpirationTime)
                .HasComment("环控设备维保到期时间")
                .HasColumnType("datetime")
                .HasColumnName("em_eqpt_expiration_time");
            entity.Property(e => e.ExternalWirelessEqptActivationTime)
                .HasComment("外网无线设备启用时间")
                .HasColumnType("datetime")
                .HasColumnName("external_wireless_eqpt_activation_time");
            entity.Property(e => e.FivegEqptActivationTime)
                .HasComment("5G设备启用时间")
                .HasColumnType("datetime")
                .HasColumnName("fiveg_eqpt_activation_time");
            entity.Property(e => e.HaveGenerator)
                .HasComment("是否有发电机")
                .HasColumnType("int(2)")
                .HasColumnName("have_generator");
            entity.Property(e => e.IntranetWirelessEqptActivationTime)
                .HasComment("内网无线设备启用时间")
                .HasColumnType("datetime")
                .HasColumnName("intranet_wireless_eqpt_activation_time");
            entity.Property(e => e.NetworkEqptActivationTime)
                .HasComment("机房网络设备启用时间")
                .HasColumnType("datetime")
                .HasColumnName("network_eqpt_activation_time");
            entity.Property(e => e.OperationEquipmentArchiveNote)
                .HasMaxLength(2048)
                .HasComment("设备档案备注")
                .HasColumnName("operation_equipment_archive_note");
            entity.Property(e => e.UpsBatteryActivationTime)
                .HasComment("ups电池启用时间")
                .HasColumnType("datetime")
                .HasColumnName("ups_battery_activation_time");
            entity.Property(e => e.UpsCabinetActivationTime)
                .HasComment("ups机柜启用时间")
                .HasColumnType("datetime")
                .HasColumnName("ups_cabinet_activation_time");
            entity.Property(e => e.UpsHostActivationTime)
                .HasComment("ups主机启用时间")
                .HasColumnType("datetime")
                .HasColumnName("ups_host_activation_time");
            entity.Property(e => e.UpsHostExpirationTime)
                .HasComment("ups主机维保到期时间")
                .HasColumnType("datetime")
                .HasColumnName("ups_host_expiration_time");
        });

        modelBuilder.Entity<OperationEvent>(entity =>
        {
            entity.HasKey(e => e.OperationEventId).HasName("PRIMARY");

            entity.ToTable("operation_event", tb => tb.HasComment("运行维护事件表"));

            entity.Property(e => e.OperationEventId)
                .HasComment("运行维护事件ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_event_id");
            entity.Property(e => e.OperationEventBranchId)
                .HasComment("运行维护事件所属机构")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_event_branch_id");
            entity.Property(e => e.OperationEventClass)
                .HasComment("运行维护事件分类ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_event_class");
            entity.Property(e => e.OperationEventDescription)
                .HasMaxLength(512)
                .HasComment("运行维护事件描述（摘要）")
                .HasColumnName("operation_event_description");
            entity.Property(e => e.OperationEventEndTime)
                .HasComment("运行维护事件结束时间")
                .HasColumnType("datetime")
                .HasColumnName("operation_event_end_time");
            entity.Property(e => e.OperationEventErrorReport)
                .HasDefaultValueSql("'0'")
                .HasComment("运行维护事件是否误报")
                .HasColumnType("int(2)")
                .HasColumnName("operation_event_error_report");
            entity.Property(e => e.OperationEventFrom)
                .HasComment("运行维护事件来源")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_event_from");
            entity.Property(e => e.OperationEventHandlerId)
                .HasComment("运行维护事件处理人")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_event_handler_id");
            entity.Property(e => e.OperationEventInfluence)
                .HasMaxLength(512)
                .HasComment("运行维护事件影响性")
                .HasColumnName("operation_event_influence");
            entity.Property(e => e.OperationEventLevel)
                .HasComment("运行维护事件等级")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_event_level");
            entity.Property(e => e.OperationEventNum)
                .HasMaxLength(32)
                .HasComment("运行维护事件编号（年月日-事件序号)")
                .HasColumnName("operation_event_num");
            entity.Property(e => e.OperationEventResult)
                .HasMaxLength(512)
                .HasComment("运行维护事件处理情况")
                .HasColumnName("operation_event_result");
            entity.Property(e => e.OperationEventStartTime)
                .HasComment("运行维护事件发生时间")
                .HasColumnType("datetime")
                .HasColumnName("operation_event_start_time");
            entity.Property(e => e.OperationEventStatus)
                .HasDefaultValueSql("'0'")
                .HasComment("运行维护事件状态")
                .HasColumnType("int(2)")
                .HasColumnName("operation_event_status");
        });

        modelBuilder.Entity<OperationIssueArchive>(entity =>
        {
            entity.HasKey(e => e.OperationIssueId).HasName("PRIMARY");

            entity.ToTable("operation_issue_archive", tb => tb.HasComment("运行维护问题跟踪档案"));

            entity.Property(e => e.OperationIssueId)
                .HasComment("运行维护问题跟踪档案ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_issue_id");
            entity.Property(e => e.DeptId)
                .HasComment("行部ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("dept_id");
            entity.Property(e => e.OperationIssueClass)
                .HasComment("问题类别")
                .HasColumnType("int(4)")
                .HasColumnName("operation_issue_class");
            entity.Property(e => e.OperationIssueCorrectiveTime)
                .HasComment("整改期限")
                .HasColumnType("datetime")
                .HasColumnName("operation_issue_corrective_time");
            entity.Property(e => e.OperationIssueDescription)
                .HasMaxLength(4096)
                .HasComment("问题描述")
                .HasColumnName("operation_issue_description");
            entity.Property(e => e.OperationIssueEndTime)
                .HasComment("解决时间")
                .HasColumnType("datetime")
                .HasColumnName("operation_issue_end_time");
            entity.Property(e => e.OperationIssueFiles)
                .HasMaxLength(4096)
                .HasComment("问题附件")
                .HasColumnName("operation_issue_files");
            entity.Property(e => e.OperationIssueResponsible)
                .HasMaxLength(32)
                .HasComment("问题责任人")
                .HasColumnName("operation_issue_responsible");
            entity.Property(e => e.OperationIssueSolution)
                .HasMaxLength(4096)
                .HasComment("解决方案")
                .HasColumnName("operation_issue_solution");
            entity.Property(e => e.OperationIssueSource)
                .HasComment("问题来源")
                .HasColumnType("int(2)")
                .HasColumnName("operation_issue_source");
            entity.Property(e => e.OperationIssueStartTime)
                .HasComment("发现时间")
                .HasColumnType("datetime")
                .HasColumnName("operation_issue_start_time");
            entity.Property(e => e.OperationIssueStatus)
                .HasDefaultValueSql("'1'")
                .HasComment("问题状态")
                .HasColumnType("int(2)")
                .HasColumnName("operation_issue_status");
            entity.Property(e => e.OperationIssueTitle)
                .HasMaxLength(512)
                .HasComment("问题标题")
                .HasColumnName("operation_issue_title");
            entity.Property(e => e.OperationIssueTracker)
                .HasComment("问题跟踪人")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_issue_tracker");
        });

        modelBuilder.Entity<OperationRoutineArchive>(entity =>
        {
            entity.HasKey(e => e.OperationRoutineArchiveId).HasName("PRIMARY");

            entity.ToTable("operation_routine_archive", tb => tb.HasComment("例行巡检档案表"));

            entity.Property(e => e.OperationRoutineArchiveId)
                .HasComment("例行巡检档案ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_routine_archive_id");
            entity.Property(e => e.OperationRoutineArchiveClass)
                .HasComment("例行巡检档案类别")
                .HasColumnType("int(4)")
                .HasColumnName("operation_routine_archive_class");
            entity.Property(e => e.OperationRoutineArchiveDescription)
                .HasMaxLength(2048)
                .HasComment("例行巡检档案描述")
                .HasColumnName("operation_routine_archive_description");
            entity.Property(e => e.OperationRoutineArchiveEndTime)
                .HasComment("例行巡检结束时间")
                .HasColumnType("datetime")
                .HasColumnName("operation_routine_archive_end_time");
            entity.Property(e => e.OperationRoutineArchiveFeedbackNecessary)
                .HasMaxLength(4)
                .HasComment("是否需要分支行反馈巡检详情")
                .HasColumnName("operation_routine_archive_feedback_necessary");
            entity.Property(e => e.OperationRoutineArchiveFileDescription)
                .HasMaxLength(2048)
                .HasComment("对附件上传要求的描述")
                .HasColumnName("operation_routine_archive_file_description");
            entity.Property(e => e.OperationRoutineArchiveFileNecessary)
                .HasMaxLength(4)
                .HasComment("是否必须上传附件")
                .HasColumnName("operation_routine_archive_file_necessary");
            entity.Property(e => e.OperationRoutineArchiveStartTime)
                .HasComment("例行巡检开始时间")
                .HasColumnType("datetime")
                .HasColumnName("operation_routine_archive_start_time");
            entity.Property(e => e.OperationRoutineArchiveStatus)
                .HasComment("例行巡检状态")
                .HasColumnType("int(4)")
                .HasColumnName("operation_routine_archive_status");
            entity.Property(e => e.OperationRoutineArchiveTitle)
                .HasMaxLength(512)
                .HasComment("例行巡检档案标题")
                .HasColumnName("operation_routine_archive_title");
        });

        modelBuilder.Entity<OperationRoutineArchiveDetail>(entity =>
        {
            entity.HasKey(e => e.OperationRoutineArchiveDetailId).HasName("PRIMARY");

            entity.ToTable("operation_routine_archive_detail", tb => tb.HasComment("例行巡检档案详情表"));

            entity.Property(e => e.OperationRoutineArchiveDetailId)
                .HasComment("例行巡检档案详情ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_routine_archive_detail_id");
            entity.Property(e => e.DeptId)
                .HasComment("行部ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("dept_id");
            entity.Property(e => e.InspectionCompleteTime)
                .HasComment("巡检完成时间")
                .HasColumnType("datetime")
                .HasColumnName("inspection_complete_time");
            entity.Property(e => e.InspectionSituation)
                .HasComment("巡检情况")
                .HasColumnType("int(4)")
                .HasColumnName("inspection_situation");
            entity.Property(e => e.InspectionSituationFeedbackPerson)
                .HasMaxLength(64)
                .HasComment("巡检情况反馈人")
                .HasColumnName("inspection_situation_feedback_person");
            entity.Property(e => e.InspectionSituationFiles)
                .HasMaxLength(4096)
                .HasComment("巡检情况附件")
                .HasColumnName("inspection_situation_files");
            entity.Property(e => e.OperationIssueIds)
                .HasMaxLength(2048)
                .HasComment("存在的问题列表（关联operation_issue表中的operation_issue_id）")
                .HasColumnName("operation_issue_ids");
            entity.Property(e => e.OperationRoutineArchiveId)
                .HasComment("例行巡检档案ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("operation_routine_archive_id");
        });

        modelBuilder.Entity<QrtzBlobTrigger>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.TriggerName, e.TriggerGroup })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0, 0 });

            entity.ToTable("QRTZ_BLOB_TRIGGERS", tb => tb.HasComment("Blob类型的触发器表"));

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.TriggerName)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_name的外键")
                .HasColumnName("trigger_name");
            entity.Property(e => e.TriggerGroup)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_group的外键")
                .HasColumnName("trigger_group");
            entity.Property(e => e.BlobData)
                .HasComment("存放持久化Trigger对象")
                .HasColumnType("blob")
                .HasColumnName("blob_data");

            entity.HasOne(d => d.QrtzTrigger).WithOne(p => p.QrtzBlobTrigger)
                .HasForeignKey<QrtzBlobTrigger>(d => new { d.SchedName, d.TriggerName, d.TriggerGroup })
                .OnDelete(DeleteBehavior.ClientSetNull)
                .HasConstraintName("QRTZ_BLOB_TRIGGERS_ibfk_1");
        });

        modelBuilder.Entity<QrtzCalendar>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.CalendarName })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });

            entity.ToTable("QRTZ_CALENDARS", tb => tb.HasComment("日历信息表"));

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.CalendarName)
                .HasMaxLength(200)
                .HasComment("日历名称")
                .HasColumnName("calendar_name");
            entity.Property(e => e.Calendar)
                .HasComment("存放持久化calendar对象")
                .HasColumnType("blob")
                .HasColumnName("calendar");
        });

        modelBuilder.Entity<QrtzCronTrigger>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.TriggerName, e.TriggerGroup })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0, 0 });

            entity.ToTable("QRTZ_CRON_TRIGGERS", tb => tb.HasComment("Cron类型的触发器表"));

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.TriggerName)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_name的外键")
                .HasColumnName("trigger_name");
            entity.Property(e => e.TriggerGroup)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_group的外键")
                .HasColumnName("trigger_group");
            entity.Property(e => e.CronExpression)
                .HasMaxLength(200)
                .HasComment("cron表达式")
                .HasColumnName("cron_expression");
            entity.Property(e => e.TimeZoneId)
                .HasMaxLength(80)
                .HasComment("时区")
                .HasColumnName("time_zone_id");

            entity.HasOne(d => d.QrtzTrigger).WithOne(p => p.QrtzCronTrigger)
                .HasForeignKey<QrtzCronTrigger>(d => new { d.SchedName, d.TriggerName, d.TriggerGroup })
                .OnDelete(DeleteBehavior.ClientSetNull)
                .HasConstraintName("QRTZ_CRON_TRIGGERS_ibfk_1");
        });

        modelBuilder.Entity<QrtzFiredTrigger>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.EntryId })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });

            entity.ToTable("QRTZ_FIRED_TRIGGERS", tb => tb.HasComment("已触发的触发器表"));

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.EntryId)
                .HasMaxLength(95)
                .HasComment("调度器实例id")
                .HasColumnName("entry_id");
            entity.Property(e => e.FiredTime)
                .HasComment("触发的时间")
                .HasColumnType("bigint(13)")
                .HasColumnName("fired_time");
            entity.Property(e => e.InstanceName)
                .HasMaxLength(200)
                .HasComment("调度器实例名")
                .HasColumnName("instance_name");
            entity.Property(e => e.IsNonconcurrent)
                .HasMaxLength(1)
                .HasComment("是否并发")
                .HasColumnName("is_nonconcurrent");
            entity.Property(e => e.JobGroup)
                .HasMaxLength(200)
                .HasComment("任务组名")
                .HasColumnName("job_group");
            entity.Property(e => e.JobName)
                .HasMaxLength(200)
                .HasComment("任务名称")
                .HasColumnName("job_name");
            entity.Property(e => e.Priority)
                .HasComment("优先级")
                .HasColumnType("int(11)")
                .HasColumnName("priority");
            entity.Property(e => e.RequestsRecovery)
                .HasMaxLength(1)
                .HasComment("是否接受恢复执行")
                .HasColumnName("requests_recovery");
            entity.Property(e => e.SchedTime)
                .HasComment("定时器制定的时间")
                .HasColumnType("bigint(13)")
                .HasColumnName("sched_time");
            entity.Property(e => e.State)
                .HasMaxLength(16)
                .HasComment("状态")
                .HasColumnName("state");
            entity.Property(e => e.TriggerGroup)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_group的外键")
                .HasColumnName("trigger_group");
            entity.Property(e => e.TriggerName)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_name的外键")
                .HasColumnName("trigger_name");
        });

        modelBuilder.Entity<QrtzJobDetail>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.JobName, e.JobGroup })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0, 0 });

            entity.ToTable("QRTZ_JOB_DETAILS", tb => tb.HasComment("任务详细信息表"));

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.JobName)
                .HasMaxLength(200)
                .HasComment("任务名称")
                .HasColumnName("job_name");
            entity.Property(e => e.JobGroup)
                .HasMaxLength(200)
                .HasComment("任务组名")
                .HasColumnName("job_group");
            entity.Property(e => e.Description)
                .HasMaxLength(250)
                .HasComment("相关介绍")
                .HasColumnName("description");
            entity.Property(e => e.IsDurable)
                .HasMaxLength(1)
                .HasComment("是否持久化")
                .HasColumnName("is_durable");
            entity.Property(e => e.IsNonconcurrent)
                .HasMaxLength(1)
                .HasComment("是否并发")
                .HasColumnName("is_nonconcurrent");
            entity.Property(e => e.IsUpdateData)
                .HasMaxLength(1)
                .HasComment("是否更新数据")
                .HasColumnName("is_update_data");
            entity.Property(e => e.JobClassName)
                .HasMaxLength(250)
                .HasComment("执行任务类名称")
                .HasColumnName("job_class_name");
            entity.Property(e => e.JobData)
                .HasComment("存放持久化job对象")
                .HasColumnType("blob")
                .HasColumnName("job_data");
            entity.Property(e => e.RequestsRecovery)
                .HasMaxLength(1)
                .HasComment("是否接受恢复执行")
                .HasColumnName("requests_recovery");
        });

        modelBuilder.Entity<QrtzLock>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.LockName })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });

            entity.ToTable("QRTZ_LOCKS", tb => tb.HasComment("存储的悲观锁信息表"));

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.LockName)
                .HasMaxLength(40)
                .HasComment("悲观锁名称")
                .HasColumnName("lock_name");
        });

        modelBuilder.Entity<QrtzPausedTriggerGrp>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.TriggerGroup })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });

            entity.ToTable("QRTZ_PAUSED_TRIGGER_GRPS", tb => tb.HasComment("暂停的触发器表"));

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.TriggerGroup)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_group的外键")
                .HasColumnName("trigger_group");
        });

        modelBuilder.Entity<QrtzSchedulerState>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.InstanceName })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });

            entity.ToTable("QRTZ_SCHEDULER_STATE", tb => tb.HasComment("调度器状态表"));

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.InstanceName)
                .HasMaxLength(200)
                .HasComment("实例名称")
                .HasColumnName("instance_name");
            entity.Property(e => e.CheckinInterval)
                .HasComment("检查间隔时间")
                .HasColumnType("bigint(13)")
                .HasColumnName("checkin_interval");
            entity.Property(e => e.LastCheckinTime)
                .HasComment("上次检查时间")
                .HasColumnType("bigint(13)")
                .HasColumnName("last_checkin_time");
        });

        modelBuilder.Entity<QrtzSimpleTrigger>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.TriggerName, e.TriggerGroup })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0, 0 });

            entity.ToTable("QRTZ_SIMPLE_TRIGGERS", tb => tb.HasComment("简单触发器的信息表"));

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.TriggerName)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_name的外键")
                .HasColumnName("trigger_name");
            entity.Property(e => e.TriggerGroup)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_group的外键")
                .HasColumnName("trigger_group");
            entity.Property(e => e.RepeatCount)
                .HasComment("重复的次数统计")
                .HasColumnType("bigint(7)")
                .HasColumnName("repeat_count");
            entity.Property(e => e.RepeatInterval)
                .HasComment("重复的间隔时间")
                .HasColumnType("bigint(12)")
                .HasColumnName("repeat_interval");
            entity.Property(e => e.TimesTriggered)
                .HasComment("已经触发的次数")
                .HasColumnType("bigint(10)")
                .HasColumnName("times_triggered");

            entity.HasOne(d => d.QrtzTrigger).WithOne(p => p.QrtzSimpleTrigger)
                .HasForeignKey<QrtzSimpleTrigger>(d => new { d.SchedName, d.TriggerName, d.TriggerGroup })
                .OnDelete(DeleteBehavior.ClientSetNull)
                .HasConstraintName("QRTZ_SIMPLE_TRIGGERS_ibfk_1");
        });

        modelBuilder.Entity<QrtzSimpropTrigger>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.TriggerName, e.TriggerGroup })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0, 0 });

            entity.ToTable("QRTZ_SIMPROP_TRIGGERS", tb => tb.HasComment("同步机制的行锁表"));

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.TriggerName)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_name的外键")
                .HasColumnName("trigger_name");
            entity.Property(e => e.TriggerGroup)
                .HasMaxLength(200)
                .HasComment("qrtz_triggers表trigger_group的外键")
                .HasColumnName("trigger_group");
            entity.Property(e => e.BoolProp1)
                .HasMaxLength(1)
                .HasComment("Boolean类型的trigger的第一个参数")
                .HasColumnName("bool_prop_1");
            entity.Property(e => e.BoolProp2)
                .HasMaxLength(1)
                .HasComment("Boolean类型的trigger的第二个参数")
                .HasColumnName("bool_prop_2");
            entity.Property(e => e.DecProp1)
                .HasPrecision(13, 4)
                .HasComment("decimal类型的trigger的第一个参数")
                .HasColumnName("dec_prop_1");
            entity.Property(e => e.DecProp2)
                .HasPrecision(13, 4)
                .HasComment("decimal类型的trigger的第二个参数")
                .HasColumnName("dec_prop_2");
            entity.Property(e => e.IntProp1)
                .HasComment("int类型的trigger的第一个参数")
                .HasColumnType("int(11)")
                .HasColumnName("int_prop_1");
            entity.Property(e => e.IntProp2)
                .HasComment("int类型的trigger的第二个参数")
                .HasColumnType("int(11)")
                .HasColumnName("int_prop_2");
            entity.Property(e => e.LongProp1)
                .HasComment("long类型的trigger的第一个参数")
                .HasColumnType("bigint(20)")
                .HasColumnName("long_prop_1");
            entity.Property(e => e.LongProp2)
                .HasComment("long类型的trigger的第二个参数")
                .HasColumnType("bigint(20)")
                .HasColumnName("long_prop_2");
            entity.Property(e => e.StrProp1)
                .HasMaxLength(512)
                .HasComment("String类型的trigger的第一个参数")
                .HasColumnName("str_prop_1");
            entity.Property(e => e.StrProp2)
                .HasMaxLength(512)
                .HasComment("String类型的trigger的第二个参数")
                .HasColumnName("str_prop_2");
            entity.Property(e => e.StrProp3)
                .HasMaxLength(512)
                .HasComment("String类型的trigger的第三个参数")
                .HasColumnName("str_prop_3");

            entity.HasOne(d => d.QrtzTrigger).WithOne(p => p.QrtzSimpropTrigger)
                .HasForeignKey<QrtzSimpropTrigger>(d => new { d.SchedName, d.TriggerName, d.TriggerGroup })
                .OnDelete(DeleteBehavior.ClientSetNull)
                .HasConstraintName("QRTZ_SIMPROP_TRIGGERS_ibfk_1");
        });

        modelBuilder.Entity<QrtzTrigger>(entity =>
        {
            entity.HasKey(e => new { e.SchedName, e.TriggerName, e.TriggerGroup })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0, 0 });

            entity.ToTable("QRTZ_TRIGGERS", tb => tb.HasComment("触发器详细信息表"));

            entity.HasIndex(e => new { e.SchedName, e.JobName, e.JobGroup }, "sched_name");

            entity.Property(e => e.SchedName)
                .HasMaxLength(120)
                .HasComment("调度名称")
                .HasColumnName("sched_name");
            entity.Property(e => e.TriggerName)
                .HasMaxLength(200)
                .HasComment("触发器的名字")
                .HasColumnName("trigger_name");
            entity.Property(e => e.TriggerGroup)
                .HasMaxLength(200)
                .HasComment("触发器所属组的名字")
                .HasColumnName("trigger_group");
            entity.Property(e => e.CalendarName)
                .HasMaxLength(200)
                .HasComment("日程表名称")
                .HasColumnName("calendar_name");
            entity.Property(e => e.Description)
                .HasMaxLength(250)
                .HasComment("相关介绍")
                .HasColumnName("description");
            entity.Property(e => e.EndTime)
                .HasComment("结束时间")
                .HasColumnType("bigint(13)")
                .HasColumnName("end_time");
            entity.Property(e => e.JobData)
                .HasComment("存放持久化job对象")
                .HasColumnType("blob")
                .HasColumnName("job_data");
            entity.Property(e => e.JobGroup)
                .HasMaxLength(200)
                .HasComment("qrtz_job_details表job_group的外键")
                .HasColumnName("job_group");
            entity.Property(e => e.JobName)
                .HasMaxLength(200)
                .HasComment("qrtz_job_details表job_name的外键")
                .HasColumnName("job_name");
            entity.Property(e => e.MisfireInstr)
                .HasComment("补偿执行的策略")
                .HasColumnType("smallint(2)")
                .HasColumnName("misfire_instr");
            entity.Property(e => e.NextFireTime)
                .HasComment("上一次触发时间（毫秒）")
                .HasColumnType("bigint(13)")
                .HasColumnName("next_fire_time");
            entity.Property(e => e.PrevFireTime)
                .HasComment("下一次触发时间（默认为-1表示不触发）")
                .HasColumnType("bigint(13)")
                .HasColumnName("prev_fire_time");
            entity.Property(e => e.Priority)
                .HasComment("优先级")
                .HasColumnType("int(11)")
                .HasColumnName("priority");
            entity.Property(e => e.StartTime)
                .HasComment("开始时间")
                .HasColumnType("bigint(13)")
                .HasColumnName("start_time");
            entity.Property(e => e.TriggerState)
                .HasMaxLength(16)
                .HasComment("触发器状态")
                .HasColumnName("trigger_state");
            entity.Property(e => e.TriggerType)
                .HasMaxLength(8)
                .HasComment("触发器的类型")
                .HasColumnName("trigger_type");

            entity.HasOne(d => d.QrtzJobDetail).WithMany(p => p.QrtzTriggers)
                .HasForeignKey(d => new { d.SchedName, d.JobName, d.JobGroup })
                .OnDelete(DeleteBehavior.ClientSetNull)
                .HasConstraintName("QRTZ_TRIGGERS_ibfk_1");
        });

        modelBuilder.Entity<SysConfig>(entity =>
        {
            entity.HasKey(e => e.ConfigId).HasName("PRIMARY");

            entity.ToTable("sys_config", tb => tb.HasComment("参数配置表"));

            entity.Property(e => e.ConfigId)
                .HasComment("参数主键")
                .HasColumnType("int(5)")
                .HasColumnName("config_id");
            entity.Property(e => e.ConfigKey)
                .HasMaxLength(100)
                .HasDefaultValueSql("''")
                .HasComment("参数键名")
                .HasColumnName("config_key");
            entity.Property(e => e.ConfigName)
                .HasMaxLength(100)
                .HasDefaultValueSql("''")
                .HasComment("参数名称")
                .HasColumnName("config_name");
            entity.Property(e => e.ConfigType)
                .HasMaxLength(1)
                .HasDefaultValueSql("'N'")
                .IsFixedLength()
                .HasComment("系统内置（Y是 N否）")
                .HasColumnName("config_type");
            entity.Property(e => e.ConfigValue)
                .HasMaxLength(500)
                .HasDefaultValueSql("''")
                .HasComment("参数键值")
                .HasColumnName("config_value");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.Remark)
                .HasMaxLength(500)
                .HasComment("备注")
                .HasColumnName("remark");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        });

        modelBuilder.Entity<SysDept>(entity =>
        {
            entity.HasKey(e => e.DeptId).HasName("PRIMARY");

            entity.ToTable("sys_dept", tb => tb.HasComment("部门表"));

            entity.Property(e => e.DeptId)
                .HasComment("部门id")
                .HasColumnType("bigint(20)")
                .HasColumnName("dept_id");
            entity.Property(e => e.Ancestors)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("祖级列表")
                .HasColumnName("ancestors");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.DelFlag)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("删除标志（0代表存在 2代表删除）")
                .HasColumnName("del_flag");
            entity.Property(e => e.DeptName)
                .HasMaxLength(30)
                .HasDefaultValueSql("''")
                .HasComment("部门名称")
                .HasColumnName("dept_name");
            entity.Property(e => e.Email)
                .HasMaxLength(50)
                .HasComment("邮箱")
                .HasColumnName("email");
            entity.Property(e => e.Leader)
                .HasMaxLength(20)
                .HasComment("负责人")
                .HasColumnName("leader");
            entity.Property(e => e.OperatingPersonnel)
                .HasMaxLength(10)
                .HasComment("运行维护人员")
                .HasColumnName("operating_personnel");
            entity.Property(e => e.OrderNum)
                .HasDefaultValueSql("'0'")
                .HasComment("显示顺序")
                .HasColumnType("int(4)")
                .HasColumnName("order_num");
            entity.Property(e => e.ParentId)
                .HasDefaultValueSql("'0'")
                .HasComment("父部门id")
                .HasColumnType("bigint(20)")
                .HasColumnName("parent_id");
            entity.Property(e => e.Phone)
                .HasMaxLength(11)
                .HasComment("联系电话")
                .HasColumnName("phone");
            entity.Property(e => e.Status)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("部门状态（0正常 1停用）")
                .HasColumnName("status");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        });

        modelBuilder.Entity<SysDeptNetEquip>(entity =>
        {
            entity.HasKey(e => e.NetEquipId).HasName("PRIMARY");

            entity.ToTable("sys_dept_net_equip", tb => tb.HasComment("行部网络设备信息"));

            entity.Property(e => e.NetEquipId)
                .HasComment("网络设备ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("net_equip_id");
            entity.Property(e => e.DeptId)
                .HasComment("所属行部ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("dept_id");
            entity.Property(e => e.LastCheckTime)
                .HasComment("上次检查时间")
                .HasColumnType("datetime")
                .HasColumnName("last_check_time");
            entity.Property(e => e.NetEquipIp)
                .HasMaxLength(50)
                .HasComment("网络设备IP")
                .HasColumnName("net_equip_ip");
            entity.Property(e => e.NetEquipName)
                .HasMaxLength(128)
                .HasComment("网络设备名称")
                .HasColumnName("net_equip_name");
            entity.Property(e => e.NetEquipType)
                .HasMaxLength(32)
                .HasComment("网络设备类型")
                .HasColumnName("net_equip_type");
        });

        modelBuilder.Entity<SysDictDatum>(entity =>
        {
            entity.HasKey(e => e.DictCode).HasName("PRIMARY");

            entity.ToTable("sys_dict_data", tb => tb.HasComment("字典数据表"));

            entity.Property(e => e.DictCode)
                .HasComment("字典编码")
                .HasColumnType("bigint(20)")
                .HasColumnName("dict_code");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.CssClass)
                .HasMaxLength(100)
                .HasComment("样式属性（其他样式扩展）")
                .HasColumnName("css_class");
            entity.Property(e => e.DictLabel)
                .HasMaxLength(100)
                .HasDefaultValueSql("''")
                .HasComment("字典标签")
                .HasColumnName("dict_label");
            entity.Property(e => e.DictSort)
                .HasDefaultValueSql("'0'")
                .HasComment("字典排序")
                .HasColumnType("int(4)")
                .HasColumnName("dict_sort");
            entity.Property(e => e.DictType)
                .HasMaxLength(100)
                .HasDefaultValueSql("''")
                .HasComment("字典类型")
                .HasColumnName("dict_type");
            entity.Property(e => e.DictValue)
                .HasMaxLength(100)
                .HasDefaultValueSql("''")
                .HasComment("字典键值")
                .HasColumnName("dict_value");
            entity.Property(e => e.IsDefault)
                .HasMaxLength(1)
                .HasDefaultValueSql("'N'")
                .IsFixedLength()
                .HasComment("是否默认（Y是 N否）")
                .HasColumnName("is_default");
            entity.Property(e => e.ListClass)
                .HasMaxLength(100)
                .HasComment("表格回显样式")
                .HasColumnName("list_class");
            entity.Property(e => e.Remark)
                .HasMaxLength(500)
                .HasComment("备注")
                .HasColumnName("remark");
            entity.Property(e => e.Status)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("状态（0正常 1停用）")
                .HasColumnName("status");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        });

        modelBuilder.Entity<SysDictType>(entity =>
        {
            entity.HasKey(e => e.DictId).HasName("PRIMARY");

            entity.ToTable("sys_dict_type", tb => tb.HasComment("字典类型表"));

            entity.HasIndex(e => e.DictType, "dict_type").IsUnique();

            entity.Property(e => e.DictId)
                .HasComment("字典主键")
                .HasColumnType("bigint(20)")
                .HasColumnName("dict_id");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.DictName)
                .HasMaxLength(100)
                .HasDefaultValueSql("''")
                .HasComment("字典名称")
                .HasColumnName("dict_name");
            entity.Property(e => e.DictType)
                .HasMaxLength(100)
                .HasDefaultValueSql("''")
                .HasComment("字典类型")
                .HasColumnName("dict_type");
            entity.Property(e => e.Remark)
                .HasMaxLength(500)
                .HasComment("备注")
                .HasColumnName("remark");
            entity.Property(e => e.Status)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("状态（0正常 1停用）")
                .HasColumnName("status");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        });

        modelBuilder.Entity<SysJob>(entity =>
        {
            entity.HasKey(e => new { e.JobId, e.JobName, e.JobGroup })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0, 0 });

            entity.ToTable("sys_job", tb => tb.HasComment("定时任务调度表"));

            entity.Property(e => e.JobId)
                .ValueGeneratedOnAdd()
                .HasComment("任务ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("job_id");
            entity.Property(e => e.JobName)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("任务名称")
                .HasColumnName("job_name");
            entity.Property(e => e.JobGroup)
                .HasMaxLength(64)
                .HasDefaultValueSql("'DEFAULT'")
                .HasComment("任务组名")
                .HasColumnName("job_group");
            entity.Property(e => e.Concurrent)
                .HasMaxLength(1)
                .HasDefaultValueSql("'1'")
                .IsFixedLength()
                .HasComment("是否并发执行（0允许 1禁止）")
                .HasColumnName("concurrent");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.CronExpression)
                .HasMaxLength(255)
                .HasDefaultValueSql("''")
                .HasComment("cron执行表达式")
                .HasColumnName("cron_expression");
            entity.Property(e => e.InvokeTarget)
                .HasMaxLength(500)
                .HasComment("调用目标字符串")
                .HasColumnName("invoke_target");
            entity.Property(e => e.MisfirePolicy)
                .HasMaxLength(20)
                .HasDefaultValueSql("'3'")
                .HasComment("计划执行错误策略（1立即执行 2执行一次 3放弃执行）")
                .HasColumnName("misfire_policy");
            entity.Property(e => e.Remark)
                .HasMaxLength(500)
                .HasDefaultValueSql("''")
                .HasComment("备注信息")
                .HasColumnName("remark");
            entity.Property(e => e.Status)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("状态（0正常 1暂停）")
                .HasColumnName("status");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        });

        modelBuilder.Entity<SysJobLog>(entity =>
        {
            entity.HasKey(e => e.JobLogId).HasName("PRIMARY");

            entity.ToTable("sys_job_log", tb => tb.HasComment("定时任务调度日志表"));

            entity.Property(e => e.JobLogId)
                .HasComment("任务日志ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("job_log_id");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.ExceptionInfo)
                .HasMaxLength(2000)
                .HasDefaultValueSql("''")
                .HasComment("异常信息")
                .HasColumnName("exception_info");
            entity.Property(e => e.InvokeTarget)
                .HasMaxLength(500)
                .HasComment("调用目标字符串")
                .HasColumnName("invoke_target");
            entity.Property(e => e.JobGroup)
                .HasMaxLength(64)
                .HasComment("任务组名")
                .HasColumnName("job_group");
            entity.Property(e => e.JobMessage)
                .HasMaxLength(500)
                .HasComment("日志信息")
                .HasColumnName("job_message");
            entity.Property(e => e.JobName)
                .HasMaxLength(64)
                .HasComment("任务名称")
                .HasColumnName("job_name");
            entity.Property(e => e.Status)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("执行状态（0正常 1失败）")
                .HasColumnName("status");
        });

        modelBuilder.Entity<SysLogininfor>(entity =>
        {
            entity.HasKey(e => e.InfoId).HasName("PRIMARY");

            entity.ToTable("sys_logininfor", tb => tb.HasComment("系统访问记录"));

            entity.Property(e => e.InfoId)
                .HasComment("访问ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("info_id");
            entity.Property(e => e.Browser)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("浏览器类型")
                .HasColumnName("browser");
            entity.Property(e => e.Ipaddr)
                .HasMaxLength(128)
                .HasDefaultValueSql("''")
                .HasComment("登录IP地址")
                .HasColumnName("ipaddr");
            entity.Property(e => e.LoginLocation)
                .HasMaxLength(255)
                .HasDefaultValueSql("''")
                .HasComment("登录地点")
                .HasColumnName("login_location");
            entity.Property(e => e.LoginName)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("登录账号")
                .HasColumnName("login_name");
            entity.Property(e => e.LoginTime)
                .HasComment("访问时间")
                .HasColumnType("datetime")
                .HasColumnName("login_time");
            entity.Property(e => e.Msg)
                .HasMaxLength(255)
                .HasDefaultValueSql("''")
                .HasComment("提示消息")
                .HasColumnName("msg");
            entity.Property(e => e.Os)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("操作系统")
                .HasColumnName("os");
            entity.Property(e => e.Status)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("登录状态（0成功 1失败）")
                .HasColumnName("status");
        });

        modelBuilder.Entity<SysMenu>(entity =>
        {
            entity.HasKey(e => e.MenuId).HasName("PRIMARY");

            entity.ToTable("sys_menu", tb => tb.HasComment("菜单权限表"));

            entity.Property(e => e.MenuId)
                .HasComment("菜单ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("menu_id");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.Icon)
                .HasMaxLength(100)
                .HasDefaultValueSql("'#'")
                .HasComment("菜单图标")
                .HasColumnName("icon");
            entity.Property(e => e.IsRefresh)
                .HasMaxLength(1)
                .HasDefaultValueSql("'1'")
                .IsFixedLength()
                .HasComment("是否刷新（0刷新 1不刷新）")
                .HasColumnName("is_refresh");
            entity.Property(e => e.MenuName)
                .HasMaxLength(50)
                .HasComment("菜单名称")
                .HasColumnName("menu_name");
            entity.Property(e => e.MenuType)
                .HasMaxLength(1)
                .HasDefaultValueSql("''")
                .IsFixedLength()
                .HasComment("菜单类型（M目录 C菜单 F按钮）")
                .HasColumnName("menu_type");
            entity.Property(e => e.OrderNum)
                .HasDefaultValueSql("'0'")
                .HasComment("显示顺序")
                .HasColumnType("int(4)")
                .HasColumnName("order_num");
            entity.Property(e => e.ParentId)
                .HasDefaultValueSql("'0'")
                .HasComment("父菜单ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("parent_id");
            entity.Property(e => e.Perms)
                .HasMaxLength(100)
                .HasComment("权限标识")
                .HasColumnName("perms");
            entity.Property(e => e.Remark)
                .HasMaxLength(500)
                .HasDefaultValueSql("''")
                .HasComment("备注")
                .HasColumnName("remark");
            entity.Property(e => e.Target)
                .HasMaxLength(20)
                .HasDefaultValueSql("''")
                .HasComment("打开方式（menuItem页签 menuBlank新窗口）")
                .HasColumnName("target");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
            entity.Property(e => e.Url)
                .HasMaxLength(200)
                .HasDefaultValueSql("'#'")
                .HasComment("请求地址")
                .HasColumnName("url");
            entity.Property(e => e.Visible)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("菜单状态（0显示 1隐藏）")
                .HasColumnName("visible");
        });

        modelBuilder.Entity<SysNotice>(entity =>
        {
            entity.HasKey(e => e.NoticeId).HasName("PRIMARY");

            entity.ToTable("sys_notice", tb => tb.HasComment("通知公告表"));

            entity.Property(e => e.NoticeId)
                .HasComment("公告ID")
                .HasColumnType("int(4)")
                .HasColumnName("notice_id");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.NoticeContent)
                .HasMaxLength(2000)
                .HasComment("公告内容")
                .HasColumnName("notice_content");
            entity.Property(e => e.NoticeTitle)
                .HasMaxLength(50)
                .HasComment("公告标题")
                .HasColumnName("notice_title");
            entity.Property(e => e.NoticeType)
                .HasMaxLength(1)
                .IsFixedLength()
                .HasComment("公告类型（1通知 2公告）")
                .HasColumnName("notice_type");
            entity.Property(e => e.Remark)
                .HasMaxLength(255)
                .HasComment("备注")
                .HasColumnName("remark");
            entity.Property(e => e.Status)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("公告状态（0正常 1关闭）")
                .HasColumnName("status");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        });

        modelBuilder.Entity<SysOperLog>(entity =>
        {
            entity.HasKey(e => e.OperId).HasName("PRIMARY");

            entity.ToTable("sys_oper_log", tb => tb.HasComment("操作日志记录"));

            entity.Property(e => e.OperId)
                .HasComment("日志主键")
                .HasColumnType("bigint(20)")
                .HasColumnName("oper_id");
            entity.Property(e => e.BusinessType)
                .HasDefaultValueSql("'0'")
                .HasComment("业务类型（0其它 1新增 2修改 3删除）")
                .HasColumnType("int(2)")
                .HasColumnName("business_type");
            entity.Property(e => e.DeptName)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("部门名称")
                .HasColumnName("dept_name");
            entity.Property(e => e.ErrorMsg)
                .HasMaxLength(2000)
                .HasDefaultValueSql("''")
                .HasComment("错误消息")
                .HasColumnName("error_msg");
            entity.Property(e => e.JsonResult)
                .HasMaxLength(2000)
                .HasDefaultValueSql("''")
                .HasComment("返回参数")
                .HasColumnName("json_result");
            entity.Property(e => e.Method)
                .HasMaxLength(100)
                .HasDefaultValueSql("''")
                .HasComment("方法名称")
                .HasColumnName("method");
            entity.Property(e => e.OperIp)
                .HasMaxLength(128)
                .HasDefaultValueSql("''")
                .HasComment("主机地址")
                .HasColumnName("oper_ip");
            entity.Property(e => e.OperLocation)
                .HasMaxLength(255)
                .HasDefaultValueSql("''")
                .HasComment("操作地点")
                .HasColumnName("oper_location");
            entity.Property(e => e.OperName)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("操作人员")
                .HasColumnName("oper_name");
            entity.Property(e => e.OperParam)
                .HasMaxLength(2000)
                .HasDefaultValueSql("''")
                .HasComment("请求参数")
                .HasColumnName("oper_param");
            entity.Property(e => e.OperTime)
                .HasComment("操作时间")
                .HasColumnType("datetime")
                .HasColumnName("oper_time");
            entity.Property(e => e.OperUrl)
                .HasMaxLength(255)
                .HasDefaultValueSql("''")
                .HasComment("请求URL")
                .HasColumnName("oper_url");
            entity.Property(e => e.OperatorType)
                .HasDefaultValueSql("'0'")
                .HasComment("操作类别（0其它 1后台用户 2手机端用户）")
                .HasColumnType("int(1)")
                .HasColumnName("operator_type");
            entity.Property(e => e.RequestMethod)
                .HasMaxLength(10)
                .HasDefaultValueSql("''")
                .HasComment("请求方式")
                .HasColumnName("request_method");
            entity.Property(e => e.Status)
                .HasDefaultValueSql("'0'")
                .HasComment("操作状态（0正常 1异常）")
                .HasColumnType("int(1)")
                .HasColumnName("status");
            entity.Property(e => e.Title)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("模块标题")
                .HasColumnName("title");
        });

        modelBuilder.Entity<SysPost>(entity =>
        {
            entity.HasKey(e => e.PostId).HasName("PRIMARY");

            entity.ToTable("sys_post", tb => tb.HasComment("岗位信息表"));

            entity.Property(e => e.PostId)
                .HasComment("岗位ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("post_id");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.PostCode)
                .HasMaxLength(64)
                .HasComment("岗位编码")
                .HasColumnName("post_code");
            entity.Property(e => e.PostName)
                .HasMaxLength(50)
                .HasComment("岗位名称")
                .HasColumnName("post_name");
            entity.Property(e => e.PostSort)
                .HasComment("显示顺序")
                .HasColumnType("int(4)")
                .HasColumnName("post_sort");
            entity.Property(e => e.Remark)
                .HasMaxLength(500)
                .HasComment("备注")
                .HasColumnName("remark");
            entity.Property(e => e.Status)
                .HasMaxLength(1)
                .IsFixedLength()
                .HasComment("状态（0正常 1停用）")
                .HasColumnName("status");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        });

        modelBuilder.Entity<SysRole>(entity =>
        {
            entity.HasKey(e => e.RoleId).HasName("PRIMARY");

            entity.ToTable("sys_role", tb => tb.HasComment("角色信息表"));

            entity.Property(e => e.RoleId)
                .HasComment("角色ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("role_id");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.DataScope)
                .HasMaxLength(1)
                .HasDefaultValueSql("'1'")
                .IsFixedLength()
                .HasComment("数据范围（1：全部数据权限 2：自定数据权限 3：本部门数据权限 4：本部门及以下数据权限）")
                .HasColumnName("data_scope");
            entity.Property(e => e.DelFlag)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("删除标志（0代表存在 2代表删除）")
                .HasColumnName("del_flag");
            entity.Property(e => e.Remark)
                .HasMaxLength(500)
                .HasComment("备注")
                .HasColumnName("remark");
            entity.Property(e => e.RoleKey)
                .HasMaxLength(100)
                .HasComment("角色权限字符串")
                .HasColumnName("role_key");
            entity.Property(e => e.RoleName)
                .HasMaxLength(30)
                .HasComment("角色名称")
                .HasColumnName("role_name");
            entity.Property(e => e.RoleSort)
                .HasComment("显示顺序")
                .HasColumnType("int(4)")
                .HasColumnName("role_sort");
            entity.Property(e => e.Status)
                .HasMaxLength(1)
                .IsFixedLength()
                .HasComment("角色状态（0正常 1停用）")
                .HasColumnName("status");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
        });

        modelBuilder.Entity<SysRoleDept>(entity =>
        {
            entity.HasKey(e => new { e.RoleId, e.DeptId })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });

            entity.ToTable("sys_role_dept", tb => tb.HasComment("角色和部门关联表"));

            entity.Property(e => e.RoleId)
                .HasComment("角色ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("role_id");
            entity.Property(e => e.DeptId)
                .HasComment("部门ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("dept_id");
        });

        modelBuilder.Entity<SysRoleMenu>(entity =>
        {
            entity.HasKey(e => new { e.RoleId, e.MenuId })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });

            entity.ToTable("sys_role_menu", tb => tb.HasComment("角色和菜单关联表"));

            entity.Property(e => e.RoleId)
                .HasComment("角色ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("role_id");
            entity.Property(e => e.MenuId)
                .HasComment("菜单ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("menu_id");
        });

        modelBuilder.Entity<SysUser>(entity =>
        {
            entity.HasKey(e => e.UserId).HasName("PRIMARY");

            entity.ToTable("sys_user", tb => tb.HasComment("用户信息表"));

            entity.Property(e => e.UserId)
                .HasComment("用户ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("user_id");
            entity.Property(e => e.Avatar)
                .HasMaxLength(100)
                .HasDefaultValueSql("''")
                .HasComment("头像路径")
                .HasColumnName("avatar");
            entity.Property(e => e.CreateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("创建者")
                .HasColumnName("create_by");
            entity.Property(e => e.CreateTime)
                .HasComment("创建时间")
                .HasColumnType("datetime")
                .HasColumnName("create_time");
            entity.Property(e => e.DelFlag)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("删除标志（0代表存在 2代表删除）")
                .HasColumnName("del_flag");
            entity.Property(e => e.DeptId)
                .HasComment("部门ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("dept_id");
            entity.Property(e => e.Email)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("用户邮箱")
                .HasColumnName("email");
            entity.Property(e => e.LoginDate)
                .HasComment("最后登录时间")
                .HasColumnType("datetime")
                .HasColumnName("login_date");
            entity.Property(e => e.LoginIp)
                .HasMaxLength(128)
                .HasDefaultValueSql("''")
                .HasComment("最后登录IP")
                .HasColumnName("login_ip");
            entity.Property(e => e.LoginName)
                .HasMaxLength(30)
                .HasComment("登录账号")
                .HasColumnName("login_name");
            entity.Property(e => e.Password)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("密码")
                .HasColumnName("password");
            entity.Property(e => e.Phonenumber)
                .HasMaxLength(11)
                .HasDefaultValueSql("''")
                .HasComment("手机号码")
                .HasColumnName("phonenumber");
            entity.Property(e => e.PwdUpdateDate)
                .HasComment("密码最后更新时间")
                .HasColumnType("datetime")
                .HasColumnName("pwd_update_date");
            entity.Property(e => e.Qiyeweixin)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("企业微信")
                .HasColumnName("qiyeweixin");
            entity.Property(e => e.Remark)
                .HasMaxLength(500)
                .HasComment("备注")
                .HasColumnName("remark");
            entity.Property(e => e.Salt)
                .HasMaxLength(20)
                .HasDefaultValueSql("''")
                .HasComment("盐加密")
                .HasColumnName("salt");
            entity.Property(e => e.Sex)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("用户性别（0男 1女 2未知）")
                .HasColumnName("sex");
            entity.Property(e => e.Status)
                .HasMaxLength(1)
                .HasDefaultValueSql("'0'")
                .IsFixedLength()
                .HasComment("帐号状态（0正常 1停用）")
                .HasColumnName("status");
            entity.Property(e => e.UpdateBy)
                .HasMaxLength(64)
                .HasDefaultValueSql("''")
                .HasComment("更新者")
                .HasColumnName("update_by");
            entity.Property(e => e.UpdateTime)
                .HasComment("更新时间")
                .HasColumnType("datetime")
                .HasColumnName("update_time");
            entity.Property(e => e.UserName)
                .HasMaxLength(30)
                .HasDefaultValueSql("''")
                .HasComment("用户昵称")
                .HasColumnName("user_name");
            entity.Property(e => e.UserType)
                .HasMaxLength(2)
                .HasDefaultValueSql("'00'")
                .HasComment("用户类型（00系统用户 01注册用户）")
                .HasColumnName("user_type");
        });

        modelBuilder.Entity<SysUserOnline>(entity =>
        {
            entity.HasKey(e => e.SessionId).HasName("PRIMARY");

            entity.ToTable("sys_user_online", tb => tb.HasComment("在线用户记录"));

            entity.Property(e => e.SessionId)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("用户会话id")
                .HasColumnName("sessionId");
            entity.Property(e => e.Browser)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("浏览器类型")
                .HasColumnName("browser");
            entity.Property(e => e.DeptName)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("部门名称")
                .HasColumnName("dept_name");
            entity.Property(e => e.ExpireTime)
                .HasDefaultValueSql("'0'")
                .HasComment("超时时间，单位为分钟")
                .HasColumnType("int(5)")
                .HasColumnName("expire_time");
            entity.Property(e => e.Ipaddr)
                .HasMaxLength(128)
                .HasDefaultValueSql("''")
                .HasComment("登录IP地址")
                .HasColumnName("ipaddr");
            entity.Property(e => e.LastAccessTime)
                .HasComment("session最后访问时间")
                .HasColumnType("datetime")
                .HasColumnName("last_access_time");
            entity.Property(e => e.LoginLocation)
                .HasMaxLength(255)
                .HasDefaultValueSql("''")
                .HasComment("登录地点")
                .HasColumnName("login_location");
            entity.Property(e => e.LoginName)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("登录账号")
                .HasColumnName("login_name");
            entity.Property(e => e.Os)
                .HasMaxLength(50)
                .HasDefaultValueSql("''")
                .HasComment("操作系统")
                .HasColumnName("os");
            entity.Property(e => e.StartTimestamp)
                .HasComment("session创建时间")
                .HasColumnType("datetime")
                .HasColumnName("start_timestamp");
            entity.Property(e => e.Status)
                .HasMaxLength(10)
                .HasDefaultValueSql("''")
                .HasComment("在线状态on_line在线off_line离线")
                .HasColumnName("status");
        });

        modelBuilder.Entity<SysUserPost>(entity =>
        {
            entity.HasKey(e => new { e.UserId, e.PostId })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });

            entity.ToTable("sys_user_post", tb => tb.HasComment("用户与岗位关联表"));

            entity.Property(e => e.UserId)
                .HasComment("用户ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("user_id");
            entity.Property(e => e.PostId)
                .HasComment("岗位ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("post_id");
        });

        modelBuilder.Entity<SysUserRole>(entity =>
        {
            entity.HasKey(e => new { e.UserId, e.RoleId })
                .HasName("PRIMARY")
                .HasAnnotation("MySql:IndexPrefixLength", new[] { 0, 0 });

            entity.ToTable("sys_user_role", tb => tb.HasComment("用户和角色关联表"));

            entity.Property(e => e.UserId)
                .HasComment("用户ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("user_id");
            entity.Property(e => e.RoleId)
                .HasComment("角色ID")
                .HasColumnType("bigint(20)")
                .HasColumnName("role_id");
        });

        OnModelCreatingPartial(modelBuilder);
    }

    partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
}
